import {
  BehaviorWithStore
} from 'mobx-miniprogram-bindings';

// 详情对象存储仓库
import {
  detailStore
} from "../../stores/detailObj"
// 购物车存储仓库
import {
  cartStore
} from "../../stores/cartObj"
// 用户存储仓库
import{
  userStore
} from "../../stores/userstore"



export const listBehavior = BehaviorWithStore({
  storeBindings: [
    {
      store: detailStore,
      fields: ['detailObj'],
      actions: ['updateDetailObj']
    },{
      store: cartStore,
      fields: ['cartList','allCount','allPrice','isSend','storeObj','addressObj','show'],
      actions: ['updateCartList','addCardObj', 'clearCardList', "changeIsSend", "changeAddressObj", "changeStoreObj",'deleteCardObj', 'changeCount', 'changeShow']
    },{
      store: userStore,
      fields: ['userInfo'],
      actions: ['setUserInfo']
    }
  ],
})